class Stack:
    def __init__(self):
        self.stack = []

    def push(self,element):
        self.stack.append(element)

    def pop(self):
        return self.stack.pop()
    
    def get_top(self):
        if self.stack:
            return self.stack[-1] # 取栈顶元素
        else:
            return None
    
def evaluate_postfix(expression):
    stack = Stack()
    num_buffer = ''
    for char in expression.split("@")[0]:  # 只取到@为止的部分
        if char.isdigit():
            num_buffer += char  # 累积数字字符
        elif char == '.' and num_buffer:  # 遇到'.'且有累积的数字
            stack.push(int(num_buffer))
            num_buffer = ''  # 清空num_buffer
        elif char in "+-*/":  # 处理运算符
            if len(stack.stack) < 2:
                raise ValueError("Invalid expression: insufficient values for operation")
            right = stack.pop()
            left = stack.pop()
            if char == "+":
                stack.push(left + right)
            elif char == "-":
                stack.push(left - right)
            elif char == "*":
                stack.push(left * right)
            elif char == "/":
                stack.push(int(left / right))  # 注意使用int进行整数除法
    if num_buffer:  # 最后可能还有一个数字未处理
        stack.push(int(num_buffer))
    
    if len(stack.stack) != 1:
        raise ValueError("Invalid expression: too many values")
    
    return stack.get_top()
if __name__ == "__main__":
    expression = input()
    result = evaluate_postfix(expression)
    print(result)


